#include "Tools.hpp"
#include <iostream>
#include <stdexcept>
#include <string>
#include <string_view>

const std::string usageInfo = R"(Usage : ztl <filepath>
        -v to print the version
        -d to print the debug info 
)";

void printUsage(){
    std::cout<<usageInfo<<'\n';
}

int main(int argc,char *argv[]){
    if(argc<2){
        throw std::runtime_error(usageInfo);
    }
    for(int i=0;i<argc;i++){
        if(std::string(argv[i])=="-v"){
            std::cout<<"Tudor Lang version alpha 0.1 by Zengtudor\nhttps://gitcode.com/Zengtudor/TudorLang\n";
        }else if(std::string(argv[i])=="-h"){
            printUsage();
        }else if(std::string(argv[i])=="-d"){
            ztl::isDebug=true;
        }
    }
    ztl::runCodeFromPath(argv[1]);
}